<layout
  th:replace="~{views/layout :: layout (
  page = 'links',
  title = ${site.title} + ' - ' + '链接列表',
  pin = ~{::pin},
  header = ~{::header},
  main = ~{::main}
  )}"
>
  <!--/* css */-->
  <th:block th:fragment="pin">
    <script id="pageScript" th:inline="javascript">
      Object.assign(window.MainApp.conf, {
        //第一屏
        enable_above: /*[[${theme.config.index.enable_above}]]*/ '',
        above_background: /*[[${theme.config.index.above_background}]]*/ '',
      });
    </script>
  </th:block>



  <!--/* header */-->
  <th:block th:fragment="header">
    <header th:class="${not theme.config.index.enable_above ? 'header dp' : 'header'}">
      <!--/* 导航栏 */-->
      <th:block th:replace="~{views/nav}"/>

      <!--第一屏内容-->
      <section class="above" th:if="${theme.config.index.enable_above}">
        <div class="above-info">
          <h1 class="above-title">链接管理</h1>
        </div>
      </section>
    </header>
  </th:block>


  <!--/* 內容 */-->
  <th:block th:fragment="main">
    <section class="content card" th:with="noData = ${not #lists.isEmpty(groups)}">
      <th:block th:if="${noData}">
        <div class="groups">
          <div class="item" th:each="group : ${groups}">
            <h2 class="name" clas th:text="${group.spec.displayName}"></h2>

            <div class="list">
              <a class="link " th:each="link : ${group.links}" th:href="${link.spec.url}" target="_blank">
                <img th:replace="~{views/components:: lazyLoadImg(${link.spec.logo},${link.spec.displayName},'logo',false,'')}"/>
                <div class="info">
                  <p class="n" th:text="${link.spec.displayName}"></p>
                  <p class="d" th:text="${link.spec.description}"></p>
                </div>
              </a>
            </div>

          </div>
        </div>

      </th:block>

      <th:block th:unless="${noData}" th:insert="~{views/components:: emptyData(false)}"></th:block>
    </section>
    <th:block th:replace="~{views/aside::common}"/>
  </th:block>
</layout>